import axios from "./axios"

// 登陆
export const login = async (username: string, password: string) => {
    return await axios.post("/sys/login", {mobile: username, password: password})
}
// 角色模块
// 详情
export const getjueses = async(id: string) => {
    return await axios.get(`/sys/role/${id}`)
}
// 列表
export const getjuese = async() => {
    return await axios.get("/sys/role")
}
// 新增
export const addjuese = async(data: any) => {
    return await axios.post("/sys/role", data)
}
// 编辑id
export const editjueseid = async(id: string) => {
    return await axios.get(`/sys/role/${id}`)
}

// 编辑
export const editjueses = async(id: string, data: any) => {
    return await axios.put(`/sys/role/${id}`, data)
}
// 删除
export const deljuese = async(id: string) => {
    return await axios.delete(`/sys/role/${id}`)
}
//分配权限
export const addjur = async(id: string, data: any) => {
    return await axios.post(`/sys/role/assignPrem/${id}`, data)
}

// 分页
export const getuser = async( page: number, pagesize: number) => {
    return await axios.get("/sys/role", {
        params: {
            page,
            pagesize
        }
    })
}

// 组织架构模块

// 获取部门列表
export const getdept = async() => {
    return await axios.get("/sys/user/simple")
}
export const getdepts = async() => {
    return await axios.get("/company/department")
}
// 删除部门
export const deldept = async(id: string) => {
    return await axios.delete(`/company/department/${id}`)
}
// 新增部门
export const adddept = async(data: any) => {
    return await axios.post("/company/department", data)
}
// 编辑部门
export const editdept = async(id: string, data: any) => {
    return await axios.put(`/company/department/${id}`, data)
}




